Learn R Programming

papaja (version 0.1.0.9655)

[,annotated_vector-method: Subsetting of Annotated Vectors

Description

When subsetting a vector by "[", all annotations (e.g., label and unit of measurement) are preserved.

Usage

# S4 method for annotated_vector
[(x, i)

# S4 method for annotated_named_vector [(x, i)

# S4 method for annotated_factor [(x, i)

# S4 method for annotated_named_factor [(x, i)

Arguments

x

The annotated_vector object to be subsetted.

i

An index specifying elements to extract or replace.

See Also

base::`[`

Examples

Run this code
# NOT RUN {
a <- new("annotated_numeric", .Data = 1:4)
test <- a[1:2]
# }

Run the code above in your browser using DataLab